<template>
  <div id="centreRight1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span style="color:#5cd9e8">
          <icon name="chart-line"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2">大棚实时报警信息</span>
        </div>
      </div>
      <div class="d-flex jc-center body-box">
        <dv-scroll-board  v-if='show==true' :config="config" style="width:7.375rem;height:4.28rem" />
      </div>
    </div>
  </div>
</template>



<script>

import {listLogNum } from '@/api/business/alarm/alarmlog'

export default {
  data() {
    return {
      show:false,
      config: {
        header: ["大棚名称","设备名称","报警名称","报警值"],
        data: [["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "66"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "35"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"],
               ["鸡毛菜棚", "温度传感器", "温度过高", "67"]],
        rowNum: 7, //表格行数
        headerHeight: 35,
        headerBGC: "#0f1325", //表头
        oddRowBGC: "#0f1325", //奇数行
        evenRowBGC: "#171c33", //偶数行
        index: true,
        columnWidth: [30],
        align: ["center"]
      }
    };
  },
  components: {},
  mounted() {},
  created(){
    this.init2()
    this.show=true
  },
  methods: {
    async init2() {
            const res = await listLogNum(10)
            var message=res.data 
            message.forEach(element => { 
            var array=new Array();
            array.push(element.groupName)
            array.push(element.deviceName)
            array.push(element.alarmName)
            array.push(element.value+'')
            this.config.data.push(array);
            });
            console.log(this.config.data)
         }

  }
};
</script>

<style lang="scss">
#centreRight1 {
  padding: 0.2rem;
  height: 5.125rem;
  min-width: 3.75rem;
  border-radius: 0.0625rem;
  .bg-color-black {
    height: 4.8125rem;
    border-radius: 0.125rem;
  }
  .text {
    color: #c3cbde;
  }
  .body-box {
    border-radius: 0.125rem;
    overflow: hidden;
  }
}
</style>